package com.binary.markdownrecord.common.service;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

import com.binary.markdownrecord.model.EvMarkdownRow;
import com.binary.markdownrecord.common.repository.EvMarkdownRowRepository;

@Service
public class EvMarkdownRowService {
    @Autowired
    private EvMarkdownRowRepository evMarkdownRowRepository;

    public EvMarkdownRow save(EvMarkdownRow obj) {
        return evMarkdownRowRepository.save(obj);
    }

    public void delete(String id) {
        evMarkdownRowRepository.deleteById(id);
    }

    public EvMarkdownRow getById(String id) {
        return evMarkdownRowRepository.getOne(id);
    }

    public List<EvMarkdownRow> listAll() {
        return evMarkdownRowRepository.findAll();
    }

    public Page<EvMarkdownRow> page(Pageable pageable) {
        return evMarkdownRowRepository.findAll(pageable);
    }
}
